#ifndef SCHED_H_
#define SCHED_H_

/*
	Copyright (C) 2011 Salil Bhagurkar

	This file is part of illusion

	illusion is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	illusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <kernel/process.h>

extern struct process *current_process;

void sched_add_process(struct process *process, uint_t prio);
void sched_change_prio(struct process *process, uint_t new_prio);
void sched_remove_process(struct process *process);
void sched_sleep_process(struct process *process);
void sched_sleep_process(struct process *process);
void sched_run_process(struct process *process);
void sched_wait_process(struct process_waitlist **waits,
		struct process_waitlist **waits_tail,
		struct process *process);
void sched_wake_waitlist(struct process_waitlist **waits,
		struct process_waitlist **waits_tail);

void sched_release();

#define NR_PRIOS 3

#define PRIO_HIGH 0
#define PRIO_NORMAL 1
#define PRIO_LOW 2

int sched_init();

#endif /* SCHED_H_ */
